<?php
/*
  $Program: ECJC Online Shop
  $Id: setcom.php
  $Based on: osCommerce, Open Source E-Commerce Solutions
  Released under the GNU General Public License
*/
  defined( 'JOSCOM_VERSION' ) or die( 'Direct Access to this location is not allowed.' );
  if (!($acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'all' )
  | $acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'com_banners' ))) {
    //j15nc
  }
  if (defined( '_OSCOMMERCE_LOADED' )) {
    if (!DB_SHARED) {
      tep_db_connect() or die('Unable to connect to database server!');
    }
    global $category_links, $languages_id, $cPath, $cPath_array, $current_category_id;
    global $request_type, $lng, $cart, $currencies, $language, $navigation, $breadcrumb;
  } else {
    require(DIR_WS_COMPONENT . 'includes/application_top.php');
  }
?>

<link rel="stylesheet" type="text/css" href="<?php echo DIR_WS_COMPONENT ?>includes/stylesheet.css">
<script language="javascript" src="<?php echo DIR_WS_COMPONENT ?>includes/menu.js"></script>
<script language="javascript" src="<?php echo DIR_WS_COMPONENT ?>includes/general.js"></script>

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>

<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE ?></td>
            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="1" width="5050" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NUMBER ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_ORDER ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATUS ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_OUTCOME_TRANSACTION_ID ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_MEMBER_IDENTIFIER ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_MEMBER_USERNAME ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_MEMBER_REFERENCE ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_BUYER_USERNAME ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_BILLING_EMAIL ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PAYMENT_CARD_TYPE ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PAYMENT_CARD_BRAND ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PAYMENT_CARD_NAME ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PAYMENT_CARD_NUMBER ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FINANCIAL_AMOUNT ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FINANCIAL_CURRENCY ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATEMENT_DATE_ADDED ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATEMENT_REFERENCE ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATEMENT_ERROR_CODE ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATEMENT_AUTHORIZATION_NUMBER ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATEMENT_TRANSACTION_KEY ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATEMENT_AMOUNT ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATEMENT_FEE ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATEMENT_TAX ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATEMENT_ROLLING_RESERVE ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATEMENT_NETT ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATEMENT_BALANCE ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATEMENT_ROLLING_RESERVE_BALANCE ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATEMENT_FUNDS_AVAILABLE ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATEMENT_ROLLING_RESERVE_AVAILABLE ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CURL_ERROR ?></td>
              </tr>
<?php
  if (isset($_REQUEST['page']) && ($_REQUEST['page'] > 1)) $rows = $_REQUEST['page'] * MAX_DISPLAY_SETCOM_RESULTS - MAX_DISPLAY_SETCOM_RESULTS;
  $rows = 0;
  $setcom_query_raw = "select s_order_id, s_date_today, s_status, s_otransid, s_identi, s_musername, s_mreference, s_busername, s_bemailadd, s_ptype, 
  s_brand, s_cardname, s_cardnum, s_famount, s_currency, s_dateadded, s_sreference, s_errorcode, s_authonum, s_transactionkey, s_samount, s_fee, s_tax, 
  s_rollreserve, s_nett, s_balance, s_rollreservebal, s_fundsavail, s_rollreserveavail, s_curlerror from " . TABLE_SETCOM . " order by s_setcom_id DESC";
  $setcom_split = new splitPageResults($_REQUEST['page'], MAX_DISPLAY_SETCOM_RESULTS, $setcom_query_raw, $setcom_query_numrows);
  $setcom_query = tep_db_query($setcom_query_raw);
  while ($setcom = tep_db_fetch_array($setcom_query)) {
    $rows++;
?>
              <tr class="dataTableContent">
                <td class="dataTableContent" align="center"><?php echo $setcom['s_order_id'] ?>&nbsp;</td>
                <td class="dataTableContent"><?php echo $setcom['s_date_today'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_status']; ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_otransid'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_identi'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_musername']; ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_mreference'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_busername'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_bemailadd'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_ptype'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_brand']; ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_cardname'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_cardnum'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_famount']; ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_currency'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_dateadded']; ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_sreference'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_errorcode'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_authonum']; ?>&nbsp;</td>
                <td class="dataTableContent"><?php echo $setcom['s_transactionkey'] ?>&nbsp;</td>
                <td class="dataTableContent"><?php echo $setcom['s_samount'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_fee']; ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_tax'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_rollreserve'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_nett']; ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_balance'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_rollreservebal'] ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_fundsavail']; ?></td>
                <td class="dataTableContent"><?php echo $setcom['s_rollreserveavail'] ?></td>
                <td class="dataTableContent"><?php echo $setcom->fields['s_curlerror'] ?>&nbsp;</td>
              </tr>
<?php
  }
?>
            </table></td>
          </tr>
          <tr>
            <td colspan="38"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td class="smallText" valign="top"><?php echo $setcom_split->display_count($setcom_query_numrows, MAX_DISPLAY_SETCOM_RESULTS, $_REQUEST['page'], TEXT_DISPLAY_NUMBER_OF_TRANSACTIONS) . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $setcom_split->display_links($setcom_query_numrows, MAX_DISPLAY_SETCOM_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_REQUEST['page']); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php');
  // -- webMS Modification --
  // reset the Mambo Database connection (stomped by osCommerce Connection)
  if (!DB_SHARED) {
    global $database, $mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db, $mosConfig_dbprefix;
    $database = new database( $mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db, $mosConfig_dbprefix );
  } ?>
